doctype html
html
    head
        title= title
        meta(content="width=device-width, minimum-scale=1.0, maximum-scale=1.0", name="viewport")
        link(href="/images/favicon.ico",type="image/x-icon",rel="shortcut icon")
        - if (process.env.NODE_ENV == 'production')
            link(rel='stylesheet', href='/stylesheets/eso-theme.min.css')
            link(rel='stylesheet', href='/stylesheets/fonts/font-awesome/css/font-awesome.min.css')
            link(rel='stylesheet', href='/stylesheets/jquery-fileupload-ui.min.css')
            link(rel='stylesheet', href='/stylesheets/project.min.css')
            - if (user && user.isFirstLogin)
                link(rel='stylesheet', href='/stylesheets/style.min.css')
                link(rel='stylesheet', href='/stylesheets/custom.min.css')
        - else
            link(rel='stylesheet', href='/stylesheets/eso-theme.css')
            link(rel='stylesheet', href='/stylesheets/fonts/font-awesome/css/font-awesome.min.css')
            link(rel='stylesheet', href='/stylesheets/jquery-fileupload-ui.css')
            link(rel='stylesheet', href='/stylesheets/project.css')
            link(rel='stylesheet', href='/stylesheets/style.css')
            link(rel='stylesheet', href='/stylesheets/custom.css')

    body
        div#wrapper
            block header
                header#eso-topbar.clearfix
                    a(onclick="cantas.navigateTo('')",title="go back home",class="logo")
                    ul(class="quick-menu unstyled clearfix")
                        li(class="dropdown header-user")
                            a(class="dropdown-toggle",data-toggle="dropdown") #{user.displayName}
                            ul(class="dropdown-menu dropdown-board")
                                li: a(href="/account") Settings
                                li: a(href="/logout") Log Out
                        li(class="dropdown header-user")
                            a(class="dropdown-toggle",data-toggle="dropdown") Board
                            ul(class="dropdown-menu dropdown-board")
                                li: a(onclick="cantas.navigateTo('boards/new')") New
                                li: a(onclick="cantas.navigateTo('boards/public')") Public Boards
                                li: a(onclick="cantas.navigateTo('boards/mine')") My Boards
                                li: a(onclick="cantas.navigateTo('boards/closed')") Closed Boards
                        li(class="dropdown header-user js-notification-menu")
                        li(class="dropdown header-user")
                            a(class="dropdown-toggle", onclick="cantas.navigateTo('help')") Help
                    form(role="form", class="js-search-form")
                        input(type="text",name="query",class="quick-search",placeholder="search")

            .quick-search-content
            block content

            - if (piwikEnable)
                input(type="hidden", id="piwik-site-id", value="#{siteId}")
                input(type="hidden", id="piwik-site-url", value="#{siteUrl}")

            block footer
                footer(class="footer")
                    div(class="hss-logo")
                    div(class="copyright")
                        | <p>Version #{version} <a href="#{links.bugzilla}" target="_blank">Report an Issue</a></p>

        block scripts
            script(type="text/javascript", src="/socket.io/socket.io.js")
            script(type="text/javascript", src="/javascripts/vendor/jade.js")
            - if (process.env.NODE_ENV == 'production')
                script(type="text/javascript", src="/javascripts/dist/vendor.min.js")
            - else
                script(type="text/javascript", src="/javascripts/vendor/jquery-2.1.1.js")
                script(type="text/javascript", src="/javascripts/vendor/jquery.slug.js")
                script(type="text/javascript", src="/javascripts/vendor/async.js")
                script(type="text/javascript", src="/javascripts/vendor/markdown.js")
                script(type="text/javascript", src="/javascripts/vendor/jquery-ui.js")
                script(type="text/javascript", src="/javascripts/vendor/underscore.js")
                script(type="text/javascript", src="/javascripts/vendor/backbone.js")
                script(type="text/javascript", src="/javascripts/vendor/backbone.iobind.js")
                script(type="text/javascript", src="/javascripts/vendor/backbone.iosync.js")
                script(type="text/javascript", src="/javascripts/vendor/moment.js")
                script(type="text/javascript", src="/javascripts/vendor/bootstrap.min.js")
                script(type='text/javascript', src='/javascripts/vendor/modernizr.custom.79639.js')
                script(type='text/javascript', src='/javascripts/vendor/jquery.ba-cond.js')
                script(type='text/javascript', src='/javascripts/vendor/jquery.slitslider.js')
                script(type='text/javascript', src='/javascripts/vendor/load-image.min.js')
                script(type='text/javascript', src='/javascripts/vendor/jquery.iframe-transport.js')
                script(type='text/javascript', src='/javascripts/vendor/jquery.fileupload.js')
                script(type='text/javascript', src='/javascripts/vendor/jquery.fileupload-process.js')
                script(type='text/javascript', src='/javascripts/vendor/jquery.fileupload-image.js')
                script(type='text/javascript', src='/javascripts/vendor/jquery.fileupload-validate.js')
                script(type='text/javascript', src='/javascripts/vendor/jquery-ui-timepicker-addon.js')

        - if (piwikEnable)
          script(type="text/javascript", class="piwik-tracker").
            try {
              var siteId = parseInt($("#piwik-site-id").val());
              var siteUrl = $("#piwik-site-url").val();
              var _paq = _paq || [];
              _paq.push(["trackPageView"]);
              _paq.push(["enableLinkTracking"]);
              _paq.push(['setCustomVariable', 1, "User",
                "#{user.displayName}", "visit"
              ]);
              (function() {
              var u=(("https:" == document.location.protocol) ?
              "https" : "http") + "://"+ siteUrl;
              _paq.push(["setTrackerUrl", u+"/piwik/piwik.php"]);
              _paq.push(["setSiteId", siteId]);
              var d=document, g=d.createElement("script"),
              s=d.getElementsByTagName("script")[0];
              g.type="text/javascript";
              g.defer=true; g.async=true;
              g.src=u+"/piwik/piwik.js"; s.parentNode.insertBefore(g,s);
              })();
            } catch( err ) {
              throw new Error('Piwik track error, detail:'+err);
            }
